<?php
//entity list
use entities\UserAccount;
use entities\AccountCurrency;
use entities\AccountType;
use entities\Account;

class FinanceController
	extends BaseController
{
	public function start()
	{
		$this->registry->template->arr_jsScriptUrls = $this->arr_appConf['js_files'];
		$this->registry->template->arr_cssSriptUrls = $this->arr_appConf['css_style_sheets'];
		$o_navi = new ClaycodeNaviMenu(
			$this->o_configuration->getApplicationsArray(), 
			array(
				'pretty_urls'=> true,
				'is_sub_navi'=> false
			)
		);
		
		$this->registry->template->arr_tabs = $this->getTabOptions();
		
		$this->registry->template->s_navi = $o_navi->getNaviHtml();
		$this->registry->template->show('Finance.php');
		
	}
	
	public function getTabOptions()
	{
		$arr_listContent = array(
			array(
				'link'=> fw_util_getAbsoluteUrl(). $this->arr_appConf['controller_class'] . 'accounts',
				'label'=> 'my accounts',
				'message'=> 'Lorem ipsum Dolor trip trip trip na sulat lang blah blah',
				'ident'=> 'my-accounts'
			),
			
			array(
				'link'=> fw_util_getAbsoluteUrl(). $this->arr_appConf['controller_class'] . 'addAccount',
				'label'=> 'test added feature',
				'message'=> 'Lorem ipsum Dolor trip trip trip na sulat lang blah blah add',
				'ident'=> 'test-added-feature'
			)
			
		);
		return $arr_listContent;
	}
	
	public function allAcounts()
	{
		
	}
	
	public function addAccount()
	{
		
	}
	
	public function delete()
	{
		
	}
	
	public function update()
	{
		
	}
	
	//service layer
	public function GetAccounts()
	{
		$o_user = $this->o_em->find('entities\UserAccount',1);
		print_r($o_user->getEmail());
		//fw_util_outputJson($o_user->getAccounts());
	}
	
}